// tslint:disable
import { Component, OnInit, Input, OnDestroy } from "@angular/core";
import { ActionSheetController, AlertController } from "@ionic/angular";
import { ModalController } from "@ionic/angular";
import { Subscription } from "rxjs";
import { MessageService } from "src/app/shared/service/message.service";
import { ActionSheetService, Modal, ModalService } from 'ng-zorro-antd-mobile';
import { EventService } from 'src/app/shared/service/event.service';
import { Platform } from '@ionic/angular';
import { AppGlobalService } from "../../shared/service/app-global.service";
import { HttpService } from "../../shared/service/http.service";
import { ShareService } from 'src/app/shared/service/share.service';
import { ImgSlidePage } from "../slides-imgage/img-slide.page";
import { PageModalService } from "src/app/shared/service/page-modal-service";
import { FormGroup, FormControl, Validators } from '@angular/forms';

@Component({
  selector: 'app-order-info-list',
  templateUrl: './order-info-list.component.html',
  styleUrls: ['./order-info-list.component.scss'],
})
/**
 * 订单列表
 * 发票申请
 * **/
export class OrderInfoListComponent implements OnInit {
  @Input() tagData: any;
  formGroup: FormGroup = new FormGroup({});
  openInformation = false;
  openRemarks = false;
  icons = [];
  remarksText = "";
  remarksIcon: any;
  phoneArray = [];
  dataIndex: any;
  firstTextStyle: any = {};
  secondTagStyle: any = {};
  firstTagStyle: any = {};
  secondTestStyle: any = {};
  pageNo: any = 1;
  params: any = { content: {} };
  currentIndex = -1;
  sessionId = localStorage.getItem("sessionId");
  // 声明订阅对象
  subscription: Subscription = null;
  emptyDataHint = "暂无数据";
  showLoadMore = false;
  pageSize: number;
  pageTotal: number;
  finalProfit: any; // 最终利润
  orderAmount: any; // 订单金额
  cost: any = 0; // 成本
  freight: any; // 运费
  freightType: any; // Add 代表添加  Sub代表减去
  discountAmount: any = 0; // 优惠金额
  customerMobile: any; // 优惠金额
  currentProfit: any; // 现利润
  finalProfitNegative: any; // 为负数时的最终利润
  currentProfitNegative: any; // 为负数时的现利润
  preview: any; // 预览修改
  showValue: any;
  public refreshIds = new Set(); // 2024.10.16 refreshIds
  constructor(
    public appGlobalService: AppGlobalService,
    private actionSheetCtrl: ActionSheetController,
    private actionSheet: ActionSheetService, // 必须有
    private alertController: AlertController,
    private eventService: EventService,
    private message: MessageService,
    private platform: Platform,
    private httpService: HttpService,
    private shareService: ShareService,
    private pageModalService: PageModalService,
    public modalController: ModalController) {
    this.eventService.eventEmit.on("orderListTagAskForList", (obj) => {
      this.refreshListData(obj);
    });

    this.eventService.eventEmit.on("openPageModalWithParams", (obj) => {
      if (obj) {
        this.openPageModalWithParams(obj);
      }
    });

    // 监听多选后
    if (this.eventService.eventEmit.listenerCount('auditNow') > 0) {
      this.eventService.eventEmit.removeListener('auditNow');
    }
    this.eventService.eventEmit.on('auditNow', obj => {
      if (obj.target) {
        this.openPageModalWithParams(obj);
      }
    });

    if (this.eventService.eventEmit.listenerCount('auditNowForNew') > 0) {
      this.eventService.eventEmit.removeListener('auditNowForNew');
    }
    this.eventService.eventEmit.on('auditNowForNew', obj => {
      if (obj.target) {
        this.openPageModalWithParams(obj);
      }
    });
  }

  openPageModalWithParams(obj) {
    const that = this;
    try {
      if (obj && (obj.type === 'modal' || obj.type == 'pageModal' || obj.type == 'model' || obj.type == 'page')) {

        if (obj.beforeSubmit && obj.params) {  // 传参都放在 submit 中
          if (that.discountAmount) {
            obj.beforeSubmit.content['discount_price'] = that.discountAmount;
          } else {
            obj.beforeSubmit.content['discount_price'] = 0;
          }
          const pattern = new RegExp('^1(3|4|5|6|7|8|9)\\d{9}$');
          if (that.customerMobile && that.customerMobile.length !== 11) {
            this.appGlobalService.showToast("手机号应为11位数", 2000, "middle");
            return;
          } else if (that.customerMobile && !that.customerMobile.match(pattern)) {
            this.appGlobalService.showToast("请填入正确的手机号", 2000, "middle");
            return;
          } else {
            if(that.customerMobile){
              obj.beforeSubmit.content['customer_mobile'] = that.customerMobile;
            }
          }
          // 蜂喔商户1.6.32最新版本
          if (obj.beforeSubmit.content['goodsIds'] !== undefined && obj.beforeSubmit.content['goodsPrices'] !== undefined && obj.beforeSubmit.content['goodsCounts'] !== undefined) {
            if (that.tagData && that.tagData.data && that.tagData.data.data) {
              let dataArray = that.tagData.data.data;
              let ids = [];  // id
              let counts = [];  // 商品数量
              let prices = [];  // 优惠价格
              for (let index = 0; index < dataArray.length; index++) {
                const element = dataArray[index];
                ids.push(element.id);
                counts.push(element.count);
                if (document.getElementById(element.id)) {
                  let ele = document.getElementById(element.id) as HTMLInputElement;
                  if (ele.value !== '') {
                    prices.push(ele.value);
                  } else {
                    prices.push(0);
                  }
                }
              }
              if (obj.beforeSubmit.content['goodsIds'] !== "") {
                obj.beforeSubmit.content[obj.beforeSubmit.content['goodsIds']] = ids.toString();
              } else {
                obj.beforeSubmit.content['goodsIds'] = ids.toString();
              }
              if (obj.beforeSubmit.content['goodsCounts'] !== "") {
                obj.beforeSubmit.content[obj.beforeSubmit.content['goodsCounts']] = counts.toString();
              } else {
                obj.beforeSubmit.content['goodsCounts'] = counts.toString();
              }
              if (obj.beforeSubmit.content['goodsPrices'] !== "") {
                obj.beforeSubmit.content[obj.beforeSubmit.content['goodsPrices']] = prices.toString();
              } else {
                obj.beforeSubmit.content['goodsPrices'] = prices.toString();
              }
              if (this.showValue && obj.beforeSubmit.content.showValue) {
                obj.beforeSubmit.content[obj.beforeSubmit.content.showValue] = this.showValue;
              }
              if (this.appGlobalService.clientType !== 'js') { // 非商户端

                if (obj.beforeSubmit.content['needUseAddressItemId'] !== ''
                  && obj.beforeSubmit.content['needUseAddressItemId'] === 'true'
                  && this.appGlobalService.addressEventResultName !== ''
                  && this.appGlobalService.addressEventResultValue !== '') {
                  obj.beforeSubmit.content[this.appGlobalService.addressEventResultName] = this.appGlobalService.addressEventResultValue;
                  console.log(new Date().toLocaleString()
                    + '.'
                    + new Date().getMilliseconds() + '  setAddressItemId	   '
                    , this.appGlobalService.addressEventResultName + '|' + this.appGlobalService.addressEventResultValue);
                }
              } else {

                if (obj.beforeSubmit.content['needUseAddressItemId'] !== ''
                  && obj.beforeSubmit.content['needUseAddressItemId'] === 'true'
                  && this.appGlobalService.addressEventResultName !== ''
                  && (this.appGlobalService.shopAddressSelectItemId !== '' || this.appGlobalService.addressEventResultValue !== '')) {
                  if (this.appGlobalService.addressEventResultValue !== '') {
                    obj.beforeSubmit.content[this.appGlobalService.addressEventResultName] = this.appGlobalService.addressEventResultValue;
                  } else {
                    obj.beforeSubmit.content[this.appGlobalService.addressEventResultName] = this.appGlobalService.shopAddressSelectItemId;
                  }
                }
              }
            }

          }
          const params = {
            content: obj.beforeSubmit.content,
            id: obj.beforeSubmit.id,
            sessionId: localStorage.getItem("sessionId")
          };
          this.httpService.post("application/submit", params, res => {
            if (res.success) {
              obj.params[obj.params.eventReturnParam] = res.data.eventResult;
              this.pageModalService.openPage(obj);
            } else {
              this.appGlobalService.showToast(res.message, 2000, "middle");
            }
          });
        } else if (obj.params) {
          if (that.discountAmount) {
            obj.params['discount_price'] = that.discountAmount;
          } else {
            obj.params['discount_price'] = 0;
          }
          const pattern = new RegExp('^1(3|4|5|6|7|8|9)\\d{9}$');
          if (!that.customerMobile && obj.params.skipVerifyCustomerMobile === undefined) {
            this.appGlobalService.showToast("请填写客户手机", 2000, "middle");
            return;
          } else if (that.customerMobile && that.customerMobile.length !== 11) {
            this.appGlobalService.showToast("手机号应为11位数", 2000, "middle");
            return;
          } else if (that.customerMobile && !that.customerMobile.match(pattern)) {
            this.appGlobalService.showToast("请填入正确的手机号", 2000, "middle");
            return;
          } else {
            if (that.customerMobile) {
              obj.params['customer_mobile'] = that.customerMobile;
            }
          }
          // 蜂喔商户1.6.32最新版本
          if (obj.params['goodsIds'] !== undefined && obj.params['goodsPrices'] !== undefined && obj.params['goodsCounts'] !== undefined) {
            if (that.tagData && that.tagData.data && that.tagData.data.data) {
              let dataArray = that.tagData.data.data;
              let ids = [];  // id
              let counts = [];  // 商品数量
              let prices = [];  // 优惠价格
              for (let index = 0; index < dataArray.length; index++) {
                const element = dataArray[index];
                ids.push(element.id);
                counts.push(element.count);
                if (document.getElementById(element.id)) {
                  let ele = document.getElementById(element.id) as HTMLInputElement;
                  if (ele.value !== '') {
                    prices.push(ele.value);
                  } else {
                    prices.push(0);
                  }
                }
              }
              if (obj.params['goodsIds'] !== "") {
                obj.params[obj.params['goodsIds']] = ids.toString();
              } else {
                obj.params['goodsIds'] = ids.toString();
              }
              if (obj.params['goodsCounts'] !== "") {
                obj.params[obj.params['goodsCounts']] = counts.toString();
              } else {
                obj.params['goodsCounts'] = counts.toString();
              }
              if (obj.params['goodsPrices'] !== "") {
                obj.params[obj.params['goodsPrices']] = prices.toString();
              } else {
                obj.params['goodsPrices'] = prices.toString();
              }

              if (this.showValue && obj.params.showValue) {
                obj.params[obj.params.showValue] = this.showValue;
              }
            }
          }
          this.pageModalService.openPage(obj);
        } else {
          return;
        }
      }
    } catch (error) {

    }
  }

  ngOnInit() {
    this.appGlobalService.needShopShipAddressId = false;
    if (this.tagData && this.tagData.data && this.tagData.data.data && this.tagData.data.data[0] && this.tagData.data.data[0].balancePayment) {
      this.appGlobalService.balancePayment = 0;
      this.appGlobalService.balancePaymentChecked = false;
      this.appGlobalService.balancePaymentCheckedCount = 0;
      this.eventService.eventEmit.on('type35SelectAllBlancePaymentIds', res => {
        this.appGlobalService.balancePayment = 0;
        let arryList = this.tagData.data.data;
        if (res) { this.appGlobalService.balancePaymentArray = arryList; }
        for (let index = 0; index < arryList.length; index++) {
          const element = arryList[index];
          element.checked = res;
          if (res) {
            this.appGlobalService.balancePayment = this.appGlobalService.balancePayment + Number(element.fourthRowLeft.price.label);

          }
        }
      });
    }

    this.appGlobalService.invoiceTotalAmount = 0;
    this.createControl();
    this.params = this.tagData.data.submit;





    if (this.tagData && this.tagData.hint) {
      this.emptyDataHint = this.tagData.hint;
    }

    if (this.tagData.data && this.tagData.data.footDiv && this.tagData.data.footDiv.details) {
      const detailsArray = this.tagData.data.footDiv.details;
      for (let j = 0; j < detailsArray.length; j++) {
        const item = detailsArray[j];
        if (item.left && item.left.orderAmount !== undefined) { // 订单金额
          this.orderAmount = item.right.secondText.label;
        } else if (item.left && item.left.finalProfit !== undefined) { // 最终利润
          this.finalProfit = item.right.secondText.label;
        } else if (item.left && item.left.cost !== undefined) { // 成本
          this.cost = item.right.secondText.label;
        } else if (item.left && item.left.freight !== undefined && item.right && item.right.secondText) { // 运费
          this.freight = item.right.secondText.label;
          this.freightType = item.left.freightType;
        } else if (item.left && item.left.discountAmount !== undefined) { // 优惠金额
          this.discountAmount = item.right.firstText.value;
        } else if (item.left && item.left.customerMobile !== undefined) { // 客户手机
          this.customerMobile = item.right.firstText.value;
        } else if (item.left && item.left.currentProfit !== undefined) { // 现利润
          this.currentProfit = item.right.secondText.label;
        } else if (item.left && item.left.preview !== undefined) { // 现利润
          this.preview = item.right.secondText.label;
        } else if (item.left && item.left.toggle !== undefined) {
          this.showValue = item.right.firstText.value;
        }
      }
    }

    // 1.9.20 新增是否是支付尾款
    if (this.tagData && this.tagData.data.data && this.tagData.data.data.length > 0) {
      if (this.tagData.data.data[0].balancePayment !== undefined) {
        this.appGlobalService.balancePaymentArray = [];
        // this.appGlobalService.balancePaymentArray = this.tagData.data.data[0];
      } else if (this.tagData.data.data[0].goods_single_cost !== undefined) {

        // 蜂喔商户1.6.32 版本新增
        this.cost = 0;
        this.discountAmount = 0;
        let dataArray = this.tagData.data.data;
        for (let index = 0; index < dataArray.length; index++) {
          const ele = dataArray[index];
          if (ele.goods_single_cost !== undefined) {
            this.cost = Number(this.cost) + Number(ele.goods_single_cost);
          }
          if (ele.goods_single_discount !== undefined) {
            this.discountAmount = Number(this.discountAmount) + Number(ele.goods_single_discount);
          }
        }
      }
    }


    // 建材商城新增确认订单
    if (this.tagData && this.tagData.data && this.tagData.data.headDiv && this.tagData.data.headDiv.checkType) {
      // this.tagData.data.data = this.getDemoData();
      let len = this.tagData.data.data.length;
      let array = this.tagData.data.data;
      let invoiceTotal = 0;
      if (len > 0 && array[0].group_type) {
        // let currentGropuType = array[0].group_type;
        for (let index = 0; index < len; index++) {
          const element = array[index];
          // if (currentGropuType && currentGropuType !== element.group_type) {
          // currentGropuType = element.group_type;
          // array[index]['isGroupLast'] = true;
          // } else if (index === (len - 1)) {
          // array[index]['isGroupLast'] = true;
          // }
          if (element.singleInvoiceAmount && element.selectType !== undefined) {
            let amount = Number(element.singleInvoiceAmount).toFixed(2);
            invoiceTotal = invoiceTotal + Number(amount);
          }
        }
      }

      if (len > 0 && array[0].showCheckBox !== undefined) {

        // 合计等于 商品可开发票金额相加
        this.appGlobalService.invoiceTotalAmount = invoiceTotal;

      }
    }

    if (this.orderAmount) {
      //  orderTemp   订单金额
      let orderTemp = Number(this.orderAmount);

      if (this.cost !== undefined) {
        // 合计等于 商品总价 - 运费（成本） - 优惠金额
        this.finalProfit = Number(orderTemp) - this.cost - this.discountAmount;
      } else {
        // 不计算 优惠金额
        this.finalProfit = Number(orderTemp) - this.discountAmount;
      }

      if (this.freightType !== undefined) {
        if (this.freightType === 'Add') {
          this.finalProfit += Number(this.freight);
        } else {
          this.finalProfit -= Number(this.freight);
        }
      }

      // 现利润
      if (this.currentProfit !== undefined) {

        this.currentProfit = 0;
        // 最终利润 = 订单金额 - 成本 - 优惠金额 - 运费

        //  freight 运费     currentProfit 现利润      finalProfit 最终利润
        if (this.freight !== undefined) {
          this.currentProfit = Number(orderTemp) - this.cost + Number(this.freight);
          if (this.currentProfit < 0) {
            this.currentProfitNegative = Math.abs(this.currentProfit);
          }
          this.appGlobalService.orderRealPayAmount = Number(this.orderAmount) - this.discountAmount + Number(this.freight);
        } else {
          this.currentProfit = Number(orderTemp) - this.cost;
          this.appGlobalService.orderRealPayAmount = Number(this.orderAmount) - this.discountAmount;
        }

        this.finalProfit = Number(this.currentProfit) - this.discountAmount;
        if (this.finalProfit < 0) {
          this.finalProfitNegative = Math.abs(this.finalProfit);
        }
      }

      this.appGlobalService.orderTotalAmount = this.finalProfit;

      if (this.currentProfit === undefined && this.cost === 0) {  // 没有'现利润'并且没有'成本'   商户端 -> 自购商城
        this.appGlobalService.orderRealPayAmount = this.finalProfit;
      }
    }
    // console.log('group_typeTagData:', this.tagData);
  }
  showModal(link) {
    const that = this;
    this.pageModalService.openPage(link, '', result => {
      if (result) {
        // that.updateItem();
      }
    });

  }
  createControl() {
    let that = this;
    if (that.tagData.data && that.tagData.data.footDiv && that.tagData.data.footDiv.details) {
      that.tagData.data.footDiv.details.forEach(element => {
        // console.log('ele=', element);
        if (element.formKey) {
          that.formGroup.addControl(element.formKey, new FormControl('', []));
        }
      });
      // that.formGroup.addControl(element.formKey, new FormControl('', []));
    }
  }
  refreshListData(param) {
    const that = this;
    if (param === undefined) {
      return;
    }
    this.pageNo = 1;
    if (!param.showName) {
      if (this.tagData.data.submit && this.tagData.data.submit.content) {
        param.showName = this.tagData.data.submit.content.showName;
      }
    }
    this.params.content = param;
    this.params.id = this.tagData.data.submit.id;
    this.params.content.pageNo = this.pageNo;
    this.params.sessionId = localStorage.getItem("sessionId");
    this.httpService.post('application/submit', this.params, res => {
      if (res.success) {
        if (res.data.submit) {
          this.params = res.data.submit; // 为了每次刷新下一页的参数 "oldIndex"
        }
        this.tagData.data.data = [];
        const result = res.data.data; // JSON.parse(res.data.data);
        this.tagData.data.data = result;
        if (res.data.moreButton) {
          this.tagData.data.moreButton = res.data.moreButton;
        }
        this.pageTotal = this.tagData.pageTotal;
        this.showLoadMore = !this.tagData.data.moreButton && this.tagData.data.submit && this.pageTotal && (this.pageNo < Math.ceil(this.pageTotal / this.pageSize)) && this.tagData.asyncShow !== 'true';
      }
    },
      err => {
        // 请求数据失败
        this.tagData.data.data = [];
        // this.appGlobalService.showToast(err.message, 2000, 'middle');
      });
  }

  /**
   *
   * @param item 打开图标
   */
  openIcon(item, dataIndex?, maxIconList?) {
    if (maxIconList && maxIconList === '2') {
      this.icons = item.slice(1);
    } else {
      this.icons = item.slice(2);
    }

    this.showActionSheet(this.icons);
    // this.openInformation = true;
    this.dataIndex = dataIndex;
  }

  normalBtnClick(buttonItem, index) {
    if (!buttonItem) {
      return;
    }
    this.dataIndex = index;
    this.iconClick(buttonItem);
  }

  /**
   * 关闭图标
   */
  hiddenInformation() {
    this.openInformation = false;
    this.openRemarks = false;
  }

  /**
   *
   * @param item 点击图标
   */
  iconClick(item) {
    const that = this;
    if (item.link && item.modelType === undefined) {
      if (item.link.type === 'page') {
        const params = {
          pageId: item.link.target,
          params: item.link.params,
          sessionId: localStorage.getItem("sessionId")
        };
        this.appGlobalService.goToForward(params);
      } else if (item.link.type === 'model') {
        item.link.modalCss = 'auto-modal';
        this.pageModalService.openPage(item.link, '', result => {
          if (result) {
          }
        });

      }
    } else if (item.button && item.modelType === undefined) {

      if (item.action && item.action === 'question') {
        // this.presentAlertWithMsgBtn(item.label, item.text ? item.text : '确定', item.button);
      } else {

        if (item.button.submit) {
        }
      }
    } else if (item.modelType === "iconLink") {
      if (item.link.type && item.link.type === 'chat') {//
        this.httpService.gotoChat(item);
      } else if (item.label === '分享') {
        const params = {
          sessionId: localStorage.getItem("sessionId"),
          pageId: item.link.target,
          params: item.link.params
        };
        this.httpService.post('application/page', params, res => {
          console.log(JSON.parse(res.script));
          const tmpShareData = JSON.parse(res.script).views[0].tags[0].data;
        });
      } else {
        // 修改
        this.pageModalService.openPage(item.link);
      }
    } else if (item.modelType === "iconSubmit") {
      const params = {
        content: item.submit.content,
        id: item.submit.id,
        sessionId: localStorage.getItem("sessionId")
      };
      this.httpService.post("application/submit", params, res => {
        this.appGlobalService.showToast(res.message, 1500, "middle");
        if (res.success) {
          if (item.link && item.link.target) {
            const pageParams = {
              pageId: item.link.target,
              params: item.link.params ? item.link.params : {},
              sessionId: localStorage.getItem("sessionId")
            };
            this.appGlobalService.goToForward(pageParams);
          }
        }
      });
    } else if (item.modelType === 'iconDelete') {
      // 删除
      const params = {
        content: item.submit.content,
        id: item.submit.id,
        sessionId: localStorage.getItem("sessionId")
      };
      this.httpService.post("application/submit", params, res => {
        this.appGlobalService.showToast(res.message, 1500, "middle");
        if (res.success) {
          if (this.dataIndex >= 0 && this.dataIndex < this.tagData.data.data.length) {
            this.tagData.data.data.splice(this.dataIndex, 1);
          }
        }
      });
    } else if (item.modelType === "phone") {
      // 电话
      this.phoneArray = item.phone.split(",");
      this.presentAlertConfirm(Number(this.phoneArray[0]), item.label);

    } else if (item.modelType === "dialog") {
    } else if (item.modelType === 'pageDialog') {

    }
  }

  selectItem(item, index) {

  }
  showActionSheet(icons) {
    const that = this;
    const buttons: any = [];
    icons.forEach((element, index) => {
      buttons.push(element.label);
    });
    ActionSheetService.showActionSheetWithOptions(
      {
        options: buttons,
        maskClosable: true
      },
      buttonIndex => {
        if (buttonIndex > -1) {
          ActionSheetService.close();
          that.iconClick(icons[buttonIndex]);
        }
      }
    );
  }

  async presentAlertConfirm(mobile, name?) {
    const msg = (name ? name + ' ' : '') + mobile;
    const alert = await this.alertController.create({
      header: this.tagData.nickName,
      message: msg,
      buttons: [
        {
          text: "取消",
          role: "cancel",
          cssClass: "secondary"
        },
        {
          text: "拨打",
          handler: () => {
            this.httpService.changeCallNumber(mobile);
          }
        }
      ]
    });

    await alert.present();
  }
  go(item) {
    if (item.showCheckBox !== undefined) {
      this.choose(item);
    } else if (item.linkButton) {
      const params = {
        content: item.linkButton.btnSubmit.submit.content,
        id: item.linkButton.btnSubmit.submit.id,
        sessionId: localStorage.getItem("sessionId")
      };
      this.httpService.post("application/submit", params, res => {
        this.appGlobalService.showToast(res.message, 1500, "middle");
        if (res.success) {

          if (res.data && res.data.eventResult) {
            // tslint:disable-next-line:no-string-literal
            item.linkButton.btnLink.link.params[item.linkButton.btnLink.link.params.eventResult] = res.data && res.data.eventResult;
          }
          this.pageModalService.openPage(item.linkButton.btnLink.link, '', (data) => {
            if (data) {

            }

          });
        }
      });
    } else {
      this.pageModalService.openPage(item.link);
    }
  }
  refreshData(event?) {
    this.params.sessionId = localStorage.getItem("sessionId");
    // 请求下一个页面
    this.pageNo = 1;
    this.params.content.pageNo = this.pageNo;
    // 请求获取新数据
    this.httpService.post("application/submit", this.params, res => {
      // 请求数据成功
      if (res.success) {

        if (Array.isArray(res.data.data) && res.data.data.length > 0) {
          this.tagData.data.data = res.data.data;

          // this.params = res.data.submit;
        } else {
          this.tagData.data.data = [];
          // 没有数据了
          // this.appGlobalService.showToast("没有数据了...", 1000, "bottom");
        }
        if (event) {
          event.target.complete();
        }

      } else {
        // 请求失败，更新当前页数
        this.tagData.data.data = [];
        this.pageNo = 1;
        // 请求数据失败
        this.appGlobalService.showToast(res.message, 2000, "middle");
        if (event) {
          event.target.complete();
        }
      }
    });
  }

  loadData(event) {
    setTimeout(() => {
      this.params.sessionId = localStorage.getItem("sessionId");
      // 请求下一个页面
      this.pageNo = this.pageNo + 1;
      this.params.content.pageNo = this.pageNo;
      // 请求获取新数据
      this.httpService.post("application/submit", this.params, res => {
        // 请求数据成功
        if (res.success) {
          // 追加返回数据
          if (Array.isArray(res.data.data) && res.data.data.length > 0) {
            // 追加数据
            res.data.data.map(item => {
              this.tagData.data.data.push(item);
            });
            // this.params = res.data.submit;
          } else {
            // 没有数据了
            // this.appGlobalService.showToast("没有数据了...", 1000, "bottom");
          }
          event.target.complete();
        } else {
          // 请求失败，更新当前页数
          this.pageNo = this.pageNo - 1;
          // 请求数据失败
          this.appGlobalService.showToast(res.message, 2000, "middle");
          event.target.complete();
        }
      });
    }, 500);
  }

  async previewImage(imageUrl, tmpIndex, isPreview) {
    // event.stopPropagation();
    if (isPreview && isPreview !== undefined) {
      // const that = this;
      let tempImageUrl = 'assets/img/default_img.png';
      if (imageUrl !== undefined) {
        tempImageUrl = imageUrl;
      }
      const value = { img: [tempImageUrl], index: tmpIndex };
      const modal = await this.modalController.create({
        component: ImgSlidePage,
        componentProps: { value: JSON.stringify(value) }
      });
      return await modal.present();
    }

  }
  call(phone, name) {
    event.stopPropagation();
    this.presentAlertConfirm(Number(phone), name);
  }
  ngOnDestroy(): void {
    this.eventService.removeCustomListListeners();
    if (this.tagData && this.refreshIds) {
      this.refreshIds.forEach(element => {
        this.eventService.removeCustomListListenersByName(element);
      });
    }
  }

  copyUrl(str) {
    this.appGlobalService.copyString(str);
  }

  // 评分
  updateRateReturn(event, item, dateIndex) {
    if (item) {

    }
    // item.data.forEach(element => {
    //   if (element.value === event) {
    //     item.showValue = element.label;
    //   }
    // });    
  }


  changeValue2(event, number) {
    if (event.detail.value > 9999999) {
      let timer = setTimeout(() => {
        event.detail.value = 9999999;
        number.value = 9999999;
        this.appGlobalService.showToast('已达到最大优惠额度', 1500, 'top');
        event.stopPropagation();
        clearTimeout(timer);
      }, 0);
      return;
    }

    let that = this;
    that.discountAmount = 0;
    // 1.最终利润 = 订单金额 - 成本 - 优惠金额。
    let dataArray = this.tagData.data.data;
    for (let index = 0; index < dataArray.length; index++) {
      const element = dataArray[index];
      if (document.getElementById(element.id) && element.id !== event['currentTarget']['id']) {
        let ele = document.getElementById(element.id) as HTMLInputElement;
        if (ele.value !== '') {
          this.discountAmount = this.discountAmount + Number(ele.value);
        }
      }
    }
    let saleTotalPrice: any = 0;
    this.discountAmount = this.discountAmount + Number(event['currentTarget']['value']);
    if (this.currentProfit !== undefined) {
      // if (this.cost) {
      //   this.finalProfit = Number(this.currentProfit) - Number(this.discountAmount) - Number(this.cost);
      //   saleTotalPrice = Number(this.currentProfit) - Number(this.discountAmount) - Number(this.cost);
      // } else {
      // this.finalProfit = Number(this.currentProfit) - Number(this.discountAmount);
      this.finalProfit = Number(this.currentProfit) - Number(this.discountAmount);
      this.finalProfit = this.finalProfit.toFixed(2);
      if (this.finalProfit < 0) {
        this.finalProfitNegative = Math.abs(this.finalProfit);
      }
      saleTotalPrice = Number(this.currentProfit) - Number(this.discountAmount);
      saleTotalPrice = saleTotalPrice.toFixed(2);

      // }
    }
    // 实收金额
    if (this.freight !== undefined) {
      this.appGlobalService.orderRealPayAmount = Number(this.orderAmount) - this.discountAmount + Number(this.freight);
    } else {
      this.appGlobalService.orderRealPayAmount = Number(this.orderAmount) - this.discountAmount;
    }

    if (saleTotalPrice < 0) {
      saleTotalPrice = 0;
    }

    if (this.appGlobalService.orderRealPayAmount <= 0) {
      this.eventService.eventEmit.emit('Total', { saleTotal: saleTotalPrice });
    }

  }
  changeValue(event, item) {
    // console.log('item', item);
    // console.log('value', event.detail.value);
    if (item.textType === 'Number') {
      // item.value = event.detail.value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')
    }
    if (event.detail.value.length > Number(item.maxLength)) {
      item.value = event.detail.value.slice(0, Number(item.maxLength));
      this.formGroup.patchValue({ [item.formKey]: item.value });
    }
    // 1.最终利润 = 订单金额 - 成本 - 优惠金额。
    // 2.实收 =  订单金额 -  优惠金额。
    if (item.formKey === 'discount_price') {
      this.discountAmount = event.detail.value;
      const orderTemp = Number(this.orderAmount).toFixed(2);
      this.finalProfit = Number(orderTemp) - event.detail.value - this.cost;
      let saleTotalPrice = Number(orderTemp) - event.detail.value;
      if (saleTotalPrice < 0) {
        saleTotalPrice = 0;
      }

      this.eventService.eventEmit.emit('Total', { saleTotal: saleTotalPrice });
    } else if (item.formKey === 'customer_mobile') {
      this.customerMobile = event.detail.value;
    }
  }

  openPage(link, e) {
    if (e) {
      e.stopPropagation();
    }
    this.pageModalService.openPage(link);
  }



  linkSubmit(btn) {

    if (btn.link && btn.submit) {
      const params = {
        content: btn.submit.content,
        id: btn.submit.id,
        sessionId: localStorage.getItem("sessionId")
      };
      this.httpService.post("application/submit", params, res => {
        this.appGlobalService.showToast(res.message, 1500, "middle");
        if (res.success) {
          if (btn.link && btn.link.target) {

            if (res.data && res.data.eventResult) {
              // tslint:disable-next-line:no-string-literal
              btn.link.params[btn.link.params.eventResult] = res.data && res.data.eventResult;
            }
            this.pageModalService.openPage(btn.link, '', (data) => {
              if (data) {

              }
            });
          }
        }
      });

    } else if (btn.submit) {
      const params = {
        content: btn.submit.content,
        id: btn.submit.id,
        sessionId: localStorage.getItem("sessionId")
      };
      this.httpService.post("application/submit", params, res => {
        this.appGlobalService.showToast(res.message, 1500, "middle");
        if (res.success) {

        }
      });
    } else if (btn.link) {
      this.pageModalService.openPage(btn.link);
    }

  }

  getInterger(value) {
    return parseInt(value);
  }


  showValueSubmit(item, state, event) {
    event.stopPropagation();
    // 0为否  1为是
    if (state === 0 && this.showValue !== '0') {
      this.showValue = '0';
    } else if (state === 1 && this.showValue !== '1') {
      this.showValue = '1';
    }
  }

  choose(item, type?) {
    if (item.id) {
      this.appGlobalService.invoiceOrderNo = item.id;
    }
    if (item.deliveryStoreId) {
      this.appGlobalService.invoiceStoreId = item.deliveryStoreId;
    }
    if (type !== undefined) {
      item.checked = !item.checked;
      let invoiceTotal = 0;
      if (this.tagData && this.tagData.data && this.tagData.data.data) {
        this.tagData.data.data.forEach(element => {
          if (element.checked) {
            if (element.singleInvoiceAmount) {
              let amount = Number(element.singleInvoiceAmount).toFixed(2);
              invoiceTotal = invoiceTotal + Number(amount);
            }
          }
        });
        this.appGlobalService.invoiceTotalAmount = invoiceTotal;
      }
    } else {

      item.checked = !item.checked;
      // if (item.balancePayment && item.checked) {
      //   this.appGlobalService.balancePayment = Number(this.appGlobalService.balancePayment + Number(item.fourthRowLeft.price.label));
      // } else if (item.balancePayment && !item.checked) {
      //   this.appGlobalService.balancePayment = Number(this.appGlobalService.balancePayment) - Number(item.fourthRowLeft.price.label);
      // }

      if (item.balancePayment) {
        this.appGlobalService.balancePayment = 0;
      }
      this.tagData.data.data.forEach(element => {
        if (item.id !== element.id) {
          element.checked = false;
        }
        if (item.balancePayment && element.checked) {
          this.appGlobalService.balancePayment = Number(this.appGlobalService.balancePayment) + Number(element.fourthRowLeft.price.label);
        }
      });

      if (item.singleInvoiceAmount) {
        this.appGlobalService.invoiceTotalAmount = Number(Number(item.singleInvoiceAmount).toFixed(2));
      }

      if (item.balancePayment) {
        let isCheckAll = 0;
        this.appGlobalService.balancePaymentArray = [];
        this.tagData.data.data.forEach(element => {
          if (element.checked) {
            isCheckAll++;
            this.appGlobalService.balancePaymentArray.push(element.itemId);
          }
        });

        if (isCheckAll === this.tagData.data.data.length) {
          this.appGlobalService.balancePaymentChecked = true;
        } else if (isCheckAll === 0) {
          this.appGlobalService.balancePaymentChecked = false;
        } else {
          this.appGlobalService.balancePaymentChecked = false;
        }
        this.appGlobalService.balancePaymentCheckedCount = isCheckAll;
      }

      if (!item.checked) {
        this.appGlobalService.invoiceTotalAmount = 0;
      }
    }
  }


  ngAfterViewInit(): void {
    let that = this;
    // 2023.12.08 是否存在刷新控件
    if (that.tagData
      && that.tagData.data
      && that.tagData.data.data
      && that.tagData.data.data.length > 0) {
      // 2023.12.08 配置了某个属性才检查是否有下拉刷新事件
      if (that.tagData.data.data[0].isShowRefresher === 'true') {
        const debouncedHandler = that.appGlobalService.debounce((data: any) => {
          if (that.tagData.refreshId !== undefined) {
            that.eventService.eventEmit.emit(that.tagData.refreshId, '1');
          }
        }, 300);
        that.eventService.eventEmit.on('checkListIsShowRefresher', debouncedHandler);

        if (that.tagData.refreshId !== undefined) {
          that.tagData.refreshId += 'a';
          that.refreshIds.add(that.tagData.refreshId);
          console.log('init list name success!', that.tagData.refreshId);
          const debouncedHandler2 = that.appGlobalService.debounce((data: any) => {
            let tempRefresher = true;
            if (tempRefresher) {
              tempRefresher = false;
              let tempParamsContent = {};
              if (!that.params) {
                that.params = { content: {} };
                if (that.tagData.data.submit.content) {
                  that.params.content = that.tagData.data.submit.content;
                }
              } else {
                if (that.params && that.params.content) {
                  tempParamsContent = JSON.parse(JSON.stringify(that.params.content));
                }
              }
              that.refreshListData(tempParamsContent);
              setTimeout(() => {
                tempRefresher = true; //防止2秒内重复请求
              }, 2000);
            }
          }, 300);
          that.eventService.eventEmit.on(that.tagData.refreshId, debouncedHandler2);
        }
      }
    }
  }





  getDemoData() {
    // let demoArray =
    //   [
    //     {
    //       deliveryRemarkBox: '1',
    //       firstRowRight: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #FF3A33;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;line-height: 1.13rem;width: 3.6rem;",
    //           label: "待发货"
    //         }
    //       },
    //       groupTypeTitleCssStyle: "padding-top:1rem",
    //       img: {
    //         imgUrl: "https://zeno-img.oss-cn-shenzhen.aliyuncs.com/file_16367746302841157c6ceb52f4184bed31f9acfd43776.jpg",
    //         cssStyle: "width:5.63rem;height:5.63rem;border-radius:0.5rem;margin-right:0.63rem;"
    //       },
    //       thirdRowLeft: {
    //         firstText: {
    //           cssStyle: "font-size: 0.69rem;font-weight: 400;color: #FF3A33;line-height: 0.69rem;padding-top:0.76rem;padding-bottom:0.19rem",
    //           label: "￥"
    //         },
    //         secondText: {
    //           cssStyle: "font-size: 1rem;font-weight: bold;color: #FF3A33;line-height: 1rem;align-items:center;padding-top:0.63rem",
    //           label: "6999.0"
    //         }
    //       },
    //       firstRowLeft: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #252629;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;line-height: 1.13rem;width: calc(100vw - 3.6rem - 9.14rem);padding-right: 0.25rem;",
    //           label: "TCL TG-V80B芭蕾白 8kg滚筒洗衣机 一级能效"
    //         }
    //       },
    //       link: {
    //         type: "page",
    //         params: {
    //           shop_goods_id: "618f3331b53ea432c1b4ec75"
    //         },
    //         target: "131327"
    //       },
    //       thirdRowRight: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #7E838C;line-height: 0.88rem;padding-bottom:1.56rem;",
    //           label: "x3"
    //         }
    //       },
    //       newBoxStyle: "1",
    //       group_type: "TCL",
    //       informationCssStyle: "margin-left:0.5rem;margin-right:0.5rem;",
    //       secondRowLeft: {
    //         firstText: {
    //           cssStyle: "background: #F2F3F5;border-radius: 0.63rem;padding:0.25rem 0.38rem;font-size: 0.69rem;color: #575A61;",
    //           label: "TCL"
    //         }
    //       }
    //     },
    //     {
    //       deliveryRemarkBox: '1',
    //       firstRowRight: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #FF3A33;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;line-height: 1.13rem;width: 3.6rem;",
    //           label: "待发货"
    //         }
    //       },
    //       groupTypeTitleCssStyle: "padding-top:1rem",
    //       img: {
    //         imgUrl: "https://zeno-img.oss-cn-shenzhen.aliyuncs.com/file_16367746302841157c6ceb52f4184bed31f9acfd43776.jpg",
    //         cssStyle: "width:5.63rem;height:5.63rem;border-radius:0.5rem;margin-right:0.63rem;"
    //       },
    //       thirdRowLeft: {
    //         firstText: {
    //           cssStyle: "font-size: 0.69rem;font-weight: 400;color: #FF3A33;line-height: 0.69rem;padding-top:0.76rem;padding-bottom:0.19rem",
    //           label: "￥"
    //         },
    //         secondText: {
    //           cssStyle: "font-size: 1rem;font-weight: bold;color: #FF3A33;line-height: 1rem;align-items:center;padding-top:0.63rem",
    //           label: "6999.0"
    //         }
    //       },
    //       firstRowLeft: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #252629;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;line-height: 1.13rem;width: calc(100vw - 3.6rem - 9.14rem);padding-right: 0.25rem;",
    //           label: "TCL TG-V80B芭蕾白 8kg滚筒洗衣机 一级能效"
    //         }
    //       },
    //       link: {
    //         type: "page",
    //         params: {
    //           shop_goods_id: "618f3331b53ea432c1b4ec75"
    //         },
    //         target: "131327"
    //       },
    //       thirdRowRight: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #7E838C;line-height: 0.88rem;padding-bottom:1.56rem;",
    //           label: "x3"
    //         }
    //       },
    //       newBoxStyle: "1",
    //       group_type: "Skyworld",
    //       informationCssStyle: "margin-left:0.5rem;margin-right:0.5rem;",
    //       secondRowLeft: {
    //         firstText: {
    //           cssStyle: "background: #F2F3F5;border-radius: 0.63rem;padding:0.25rem 0.38rem;font-size: 0.69rem;color: #575A61;",
    //           label: "TCL"
    //         }
    //       }
    //     },
    //     {
    //       deliveryRemarkBox: '1',
    //       firstRowRight: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #FF3A33;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;line-height: 1.13rem;width: 3.6rem;",
    //           label: "待发货"
    //         }
    //       },
    //       groupTypeTitleCssStyle: "padding-top:1rem",
    //       img: {
    //         imgUrl: "https://zeno-img.oss-cn-shenzhen.aliyuncs.com/file_1662618190555c6baec5c79fc6ae6743738549b9006af.gif",
    //         cssStyle: "width:5.63rem;height:5.63rem;border-radius:0.5rem;margin-right:0.63rem;"
    //       },
    //       thirdRowLeft: {
    //         firstText: {
    //           cssStyle: "font-size: 0.69rem;font-weight: 400;color: #FF3A33;line-height: 0.69rem;padding-top:0.76rem;padding-bottom:0.19rem",
    //           label: "￥"
    //         },
    //         secondText: {
    //           cssStyle: "font-size: 1rem;font-weight: bold;color: #FF3A33;line-height: 1rem;align-items:center;padding-top:0.63rem",
    //           label: "123.0"
    //         }
    //       },
    //       firstRowLeft: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #252629;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;line-height: 1.13rem;width: calc(100vw - 3.6rem - 9.14rem);padding-right: 0.25rem;",
    //           label: "瓷砖111"
    //         }
    //       },
    //       link: {
    //         type: "page",
    //         params: {
    //           shop_goods_id: "63198a7df16b0d2ec37051bf"
    //         },
    //         target: "131327"
    //       },
    //       thirdRowRight: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #7E838C;line-height: 0.88rem;padding-bottom:1.56rem;",
    //           label: "x1"
    //         }
    //       },
    //       newBoxStyle: "1",
    //       group_type: "123",
    //       informationCssStyle: "margin-left:0.5rem;margin-right:0.5rem;",
    //       secondRowLeft: {
    //         firstText: {
    //           cssStyle: "background: #F2F3F5;border-radius: 0.63rem;padding:0.25rem 0.38rem;font-size: 0.69rem;color: #575A61;",
    //           label: "123"
    //         }
    //       }
    //     },
    //     {
    //       deliveryRemarkBox: '1',
    //       firstRowRight: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #FF3A33;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;line-height: 1.13rem;width: 3.6rem;",
    //           label: "待发货"
    //         }
    //       },
    //       groupTypeTitleCssStyle: "padding-top:1rem",
    //       img: {
    //         imgUrl: "https://zeno-img.oss-cn-shenzhen.aliyuncs.com/file_16626183387370757ccf548f200762dddc6539629d8fb.jpg",
    //         cssStyle: "width:5.63rem;height:5.63rem;border-radius:0.5rem;margin-right:0.63rem;"
    //       },
    //       thirdRowLeft: {
    //         firstText: {
    //           cssStyle: "font-size: 0.69rem;font-weight: 400;color: #FF3A33;line-height: 0.69rem;padding-top:0.76rem;padding-bottom:0.19rem",
    //           label: "￥"
    //         },
    //         secondText: {
    //           cssStyle: "font-size: 1rem;font-weight: bold;color: #FF3A33;line-height: 1rem;align-items:center;padding-top:0.63rem",
    //           label: "123.0"
    //         }
    //       },
    //       firstRowLeft: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #252629;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;line-height: 1.13rem;width: calc(100vw - 3.6rem - 9.14rem);padding-right: 0.25rem;",
    //           label: "瓷砖222"
    //         }
    //       },
    //       link: {
    //         type: "page",
    //         params: {
    //           shop_goods_id: "63198b0ff16b0d2ec37051c1"
    //         },
    //         target: "131327"
    //       },
    //       thirdRowRight: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #7E838C;line-height: 0.88rem;padding-bottom:1.56rem;",
    //           label: "x13"
    //         }
    //       },
    //       newBoxStyle: "1",
    //       group_type: "123",
    //       informationCssStyle: "margin-left:0.5rem;margin-right:0.5rem;",
    //       secondRowLeft: {
    //         firstText: {
    //           cssStyle: "background: #F2F3F5;border-radius: 0.63rem;padding:0.25rem 0.38rem;font-size: 0.69rem;color: #575A61;",
    //           label: "123"
    //         }
    //       }
    //     },
    //     {
    //       deliveryRemarkBox: '1',
    //       firstRowRight: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #FF3A33;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;line-height: 1.13rem;width: 3.6rem;",
    //           label: "待发货"
    //         }
    //       },
    //       groupTypeTitleCssStyle: "padding-top:1rem",
    //       img: {
    //         imgUrl: "https://zeno-img.oss-cn-shenzhen.aliyuncs.com/file_16626183387370757ccf548f200762dddc6539629d8fb.jpg",
    //         cssStyle: "width:5.63rem;height:5.63rem;border-radius:0.5rem;margin-right:0.63rem;"
    //       },
    //       thirdRowLeft: {
    //         firstText: {
    //           cssStyle: "font-size: 0.69rem;font-weight: 400;color: #FF3A33;line-height: 0.69rem;padding-top:0.76rem;padding-bottom:0.19rem",
    //           label: "￥"
    //         },
    //         secondText: {
    //           cssStyle: "font-size: 1rem;font-weight: bold;color: #FF3A33;line-height: 1rem;align-items:center;padding-top:0.63rem",
    //           label: "123.0"
    //         }
    //       },
    //       firstRowLeft: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #252629;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;line-height: 1.13rem;width: calc(100vw - 3.6rem - 9.14rem);padding-right: 0.25rem;",
    //           label: "瓷砖222"
    //         }
    //       },
    //       link: {
    //         type: "page",
    //         params: {
    //           shop_goods_id: "63198b0ff16b0d2ec37051c1"
    //         },
    //         target: "131327"
    //       },
    //       thirdRowRight: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #7E838C;line-height: 0.88rem;padding-bottom:1.56rem;",
    //           label: "x13"
    //         }
    //       },
    //       newBoxStyle: "1",
    //       group_type: "123",
    //       informationCssStyle: "margin-left:0.5rem;margin-right:0.5rem;",
    //       secondRowLeft: {
    //         firstText: {
    //           cssStyle: "background: #F2F3F5;border-radius: 0.63rem;padding:0.25rem 0.38rem;font-size: 0.69rem;color: #575A61;",
    //           label: "123"
    //         }
    //       }
    //     },
    //     {
    //       deliveryRemarkBox: '1',
    //       hiddenBottomLine: '1',
    //       firstRowRight: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #FF3A33;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;line-height: 1.13rem;width: 3.6rem;",
    //           label: "待发货"
    //         }
    //       },
    //       groupTypeTitleCssStyle: "padding-top:1rem",
    //       img: {
    //         imgUrl: "https://zeno-img.oss-cn-shenzhen.aliyuncs.com/file_16626183387370757ccf548f200762dddc6539629d8fb.jpg",
    //         cssStyle: "width:5.63rem;height:5.63rem;border-radius:0.5rem;margin-right:0.63rem;"
    //       },
    //       thirdRowLeft: {
    //         firstText: {
    //           cssStyle: "font-size: 0.69rem;font-weight: 400;color: #FF3A33;line-height: 0.69rem;padding-top:0.76rem;padding-bottom:0.19rem",
    //           label: "￥"
    //         },
    //         secondText: {
    //           cssStyle: "font-size: 1rem;font-weight: bold;color: #FF3A33;line-height: 1rem;align-items:center;padding-top:0.63rem",
    //           label: "123.0"
    //         }
    //       },
    //       firstRowLeft: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #252629;display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;line-height: 1.13rem;width: calc(100vw - 3.6rem - 9.14rem);padding-right: 0.25rem;",
    //           label: "瓷砖222"
    //         }
    //       },
    //       link: {
    //         type: "page",
    //         params: {
    //           shop_goods_id: "63198b0ff16b0d2ec37051c1"
    //         },
    //         target: "131327"
    //       },
    //       thirdRowRight: {
    //         firstText: {
    //           cssStyle: "font-size: 0.88rem;font-weight: 400;color: #7E838C;line-height: 0.88rem;padding-bottom:1.56rem;",
    //           label: "x13"
    //         }
    //       },
    //       newBoxStyle: "1",
    //       group_type: "123",
    //       informationCssStyle: "margin-left:0.5rem;margin-right:0.5rem;",
    //       secondRowLeft: {
    //         firstText: {
    //           cssStyle: "background: #F2F3F5;border-radius: 0.63rem;padding:0.25rem 0.38rem;font-size: 0.69rem;color: #575A61;",
    //           label: "123"
    //         }
    //       }
    //     }
    //   ];
    // return demoArray;
  }
}

